﻿@model IEnumerable<WeberTimeTracker.Models.Report_Last_Billing>

@{
    ViewBag.Title = "Index";
    Layout = "~/Views/Shared/_Layout.cshtml";
}

<script>
	$().ready(function () {
		$.ajax({
			url: "/Report/ReportEmployee",
			success: function (data) {
				$('#employee').html(data);
			}
		});
		$.ajax({
			url: "/Report/ReportUnpaid",
			success: function (data) {
				$('#unpaid').html(data);
			}
		});

		$('#submit').click(function () {
			var fromdatebox = $('#fromdatebox').val();
			var todatebox = $('#todatebox').val();
			$.ajax({
				url: "/Report/ReportPeriod",
				data: { fromdate: fromdatebox, todate: todatebox },
				success: function (data) {
					$('#period').html(data);
				}
			});
		});
	});
</script>

<div class="reports">
      <h3>Hours by Employee</h3>
      <div id="employee"></div>
</div>
<div class="reports">
        <h3>Hours by Period</h3>
        <table>
          <tr>
	        <td>
                From: 
            </td>
            <td>
                <input id="fromdatebox" type="text" style="width: 100px;" />
            </td>
          </tr>
	      <tr>
            <td>
                To: 
            </td>
            <td>
                <input id="todatebox" type="text" style="width: 100px;" />
            </td>
			<td>
                <input id="submit" type="button" value="Submit" />
            </td>
          </tr>
        </table>
        <div id="period"></div>
</div>
<div class="reports">
    <h3>Hours Unpaid</h3>
    <div id="unpaid"></div>
</div>
<br class="reports" />